#!*------------------------------------------------------------
#!*
#!*  Project:        Clarion Open Source Project
#!*                  http://clarion.googlecode.com/
#!*
#!*  Module:         Class cosOptions cos_Options.tpl
#!*  Created:        10/04/2008 11:18PM
#!*
#!*  The MIT License
#!*
#!*  Copyright (c) 2008 Lee White
#!*
#!*  Permission is hereby granted, free of charge, to any person obtaining a copy
#!*  of this software and associated documentation files (the "Software"), to deal
#!*  in the Software without restriction, including without limitation the rights
#!*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#!*  copies of the Software, and to permit persons to whom the Software is
#!*  furnished to do so, subject to the following conditions:
#!*
#!*  The above copyright notice and this permission notice shall be included in
#!*  all copies or substantial portions of the Software.
#!*
#!*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#!*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#!*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#!*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#!*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#!*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#!*  THE SOFTWARE.
#!*
#!*  Comments:  Thanks to Lee White for his generous controbution of this
#!*             template in its original form.
#!*
#!*------------------------------------------------------------
#!*
#!*  History:   10/05/2008  v1.0.0.0 release
#!*
#!*             10/7/2008 corrected an omission that prevented exporting of
#!*             declared class instance. See %DLLExportList below
#!*
#!*             10/7/2008 v1.0.0.1 release to tag template change
#!*
#!*             Template mangled by Mark Geisinger to support generation of
#!*             declaration of external class instance
#!*
#!*------------------------------------------------------------
#!
#! cosOptionsClass
#! Replace all instances with the name of your template set
#!
#! cos Options Class
#! Replace all instances with the description of this template
#!
#! cosOptions
#! The label for local use of class methods: InstanceObjectName.MyMethod
#! Replace all instances with the label of your object
#!
#! cosOptions
#! Replace all instances with the default name of your object
#!
#! cosOptions
#! Replace all instances with the name of your class
#!
#TEMPLATE(cosOptionsClass,'cos Options Class Global Extension'),FAMILY('ABC')
#!------------------------------------------------------------------------------
#EXTENSION(cosOptionsClassGlobal,'cos Options Class'),APPLICATION
#!------------------------------------------------------------------------------
#PREPARE
  #CALL(%ReadABCFiles(ABC))
  #CALL(%SetClassDefaults(ABC), 'MycosOptionsObj', 'MycosOptions', %ClassName)
#ENDPREPARE
#ATSTART
  #CALL(%ReadABCFiles(ABC))
  #CALL(%SetClassDefaults(ABC), 'MycosOptionsObj', 'MycosOptions', %ClassName)
#ENDAT
#INSERT(%OOPPrompts(ABC))
#SHEET
  #TAB('Setup')
    #DISPLAY('Your global template prompts')
  #ENDTAB
  #TAB('Class')
    #BOXED('')
      #PROMPT('Class:',FROM(%pClassName)),%ClassName,DEFAULT('cosOptions'),REQ
    #ENDBOXED
    #BOXED('')
      #BUTTON('My Class'),AT(,,170)
        #WITH(%ClassItem,'MycosOptionsObj')
         #INSERT(%GlobalClassPrompts(ABC))
        #ENDWITH
      #ENDBUTTON
    #ENDBOXED
    #BUTTON('Library Files'),AT(,,170)
      #BOXED('Library Files')
        #INSERT(%AbcLibraryPrompts(ABC))
      #ENDBOXED
    #ENDBUTTON
  #ENDTAB
#ENDSHEET

#AT(%DLLExportList),PRIORITY(4000)
  $MYCOSOPTIONS                                          @?
#ENDAT

#!
#! This section is required for exporting the class methods
#!
#! Remember, "MYCLASSINC" must be uppercase here and as used in
#! !ABCIncludeFile(MYCLASSINC) within your class include file
#!
#! "MyClass" is the prefix to _DLLMode_ and _LinkMode_ parameters in your class definition
#!
#AT (%BeforeGenerateApplication)
  #CALL(%AddCategory(ABC),'COS_OPTIONS')
  #CALL(%SetCategoryLocation(ABC), 'COS_OPTIONS', 'cosOptions')
#ENDAT


#!
#! For global method calls, if needed...
#!
#AT(%GatherObjects)
  #CALL(%AddObjectList(ABC),'MycosOptionsObj')
#ENDAT

#AT(%GlobalData)
#if(%GlobalExternal)
#INSERT(%GenerateClass(ABC), 'MycosOptionsObj', , %False, 'EXTERNAL,DLL(dll_mode)')
#else
#INSERT(%GenerateClass(ABC), 'MycosOptionsObj')
#endif
#ENDAT

#! #AT(%GlobalData)
#! #INSERT(%GenerateClass(ABC),'MycosOptionsObj')
#! #ENDAT

#!
#! For global embed access, if needed...
#!
#AT(%ProgramProcedures), WHERE(%ProgramExtension<>'DLL')
  #CALL(%GenerateVirtuals(ABC), 'MycosOptionsObj', 'Global Objects|cos Options Class', '%GlobalEmbedVirtuals(cosOptionsClass)', %TRUE)
#ENDAT

#AT(%cosOptionsMethodCodeSection),PRIORITY(5000),DESCRIPTION('Parent Call'),WHERE(%ParentCallValid())
  #CALL(%GenerateParentCall(ABC))
#ENDAT
#!
#! Groups required for global embed access...
#!
#GROUP(%GlobalEmbedVirtuals, %TreeText, %DataText, %CodeText)
#EMBED(%cosOptionsMethodDataSection, 'cos Options Class Method Data Section'),%pClassMethod,%pClassMethodPrototype,LABEL,DATA,TREE(%TreeText & %DataText)
  #?CODE
  #EMBED(%cosOptionsMethodCodeSection, 'cos Options Class Method Code Section'),%pClassMethod,%pClassMethodPrototype,TREE(%TreeText & %CodeText)
#!
#GROUP(%ParentCallValid),AUTO
#DECLARE(%RVal)
#CALL(%ParentCallValid(ABC)),%RVal
#RETURN(%RVal)
